﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta name="description" content="This is a Login Page" />
    <title>鼎宴工坊 账务管理系统 Ver 1.0.0</title>
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/styles/wheelcontainer.css" rel="stylesheet" type="text/css" />

    <script src="~/Content/jquery/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="~/Content/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="@Url.Content("/content/whale/whale.js")" type="text/javascript"></script>
    <script src="@Url.Content("/content/whale/whale.remote.js")" type="text/javascript"></script>

    <style>
        #header { background: url(/Content/images/4.png); height: 66px; box-shadow: 0px 1px 0px #FFFFFF; border-bottom: 1px solid #c4c4c4; }
        #header div { text-align: center; }
        #header div h2 { color: #353535; font-size: 30px; font-weight: 700; outline-color: #353535; text-shadow: #FFFFFF 0px 1px 0px; display: inline-block; }
        #header div span { color: #6b6b6b; font-size: 14px; font-weight: 700; text-shadow: #FFFFFF 0px 1px 0px; }
    </style>
</head>
<body>
    <div id="header">
        <div>
            <h2>鼎宴工坊 账务管理系统 Ver 1.0.0</h2>
        </div>
    </div>

    <div class="container-fluid">
        <div class="wheelContainer">
            <form method="post" action="#">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="row-fluid">
                            <label for="txtUserName" class="span12">
                                用户名：
                            <span class="icon16 icomoon-icon-user-3 right gray marginR10"></span>
                            </label>
                            <input type="text" placeholder="请输入用户名" id="txtUserName" name="userName" class="span12" tabindex="1" />
                        </div>

                        <div class="row-fluid">
                            <label for="txtPassword" class="span12">
                                密&nbsp;&nbsp;码：
                                <span class="icon16 icomoon-icon-locked right gray marginR10"></span>
                                <span class="forgot">
                                    <a href="#">忘记密码</a>
                                </span>
                            </label>
                            <input type="password" placeholder="请输入密码" id="txtPassword" name="password" class="span12" tabindex="2" />
                        </div>

                        <div class="row-fluid" id="msg" style="display: none">
                            <div class="alert alert-error">
                                <b>错误：</b>
                                <span>用户名或密码错误</span>
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="form-action">
                                <button id="loginBtn" class="btn btn-info right" type="submit" tabindex="4">
                                    <span class="icon16 icomoon-icon-enter white"></span>
                                    Login
                                </button>
                            </div>
                        </div>

                    </div>
                </div>
            </form>
        </div>
    </div>

    <script>
        $(function () {
            $("#loginBtn").click(function () {
                $("#msg").toggle(false);
                Whale.Remote.Operation({
                    url: "/UserLogin",
                    parameters: {
                        userName: $("#txtUserName").val(),
                        password: $("#txtPassword").val()
                    },
                    success: function (response) {
                        var url = "@Request["ReturnUrl"]";
                        if (url == "" || url == null) url = "/home";
                        location.href = url;
                    },
                    error: function (msg) {
                        $("#msg div span").html(msg);
                        $("#msg").fadeIn();
                    }
                });
                return false;
            });
        });
    </script>
</body>
</html>
